1. Field of the Invention
The present invention relates to wireless LAN devices and communication mode switching methods, and more particularly, to a wireless LAN device for controlling a plurality of access points and a communication mode switching method for such a wireless LAN device.
2. Description of the Related Art
Wireless LAN (Local Area Network) is known as a typical example of networks enabling wireless communication between terminals. Representative specifications of wireless LANs have been formulated by the IEEE (Institute of Electrical and Electronic Engineers) as IEEE 802.11a, IEEE 802.11b/g, etc. Currently, these types of wireless LANs are widely used at homes and in offices.
Wireless LANs are configured in either of two modes, namely, infrastructure mode and ad-hoc mode. In infrastructure mode, the network is constituted by a base station called access point (AP), and a terminal called mobile station (MS) which is within the coverage of radio waves.
FIG. 21 exemplifies a network operating in infrastructure mode. An access point 203 is connected, for example, to a wired Ethernet (registered trademark) backbone network 201. To the backbone network 201 is connected a terminal (station; in the figure, ST) 202 for performing wired communications. The access point 203 communicates by wireless with mobile stations 204a and 204b associated therewith to allow exchange of packets between the mobile stations 204a and 204b and between the mobile station 204a, 204b and the station 202.
Ad-hoc mode, by contrast, requires no access point and the network is constituted by mobile stations only.
FIG. 22 exemplifies a network operating in ad-hoc mode. Mobile stations 211a and 211b directly exchange packets with each other by wireless, without through the agency of an access point. In the figure, the ellipses indicate the radio wave coverage areas of the respective mobile stations 211a and 211b. 
There have been known conventional techniques wherein mobile stations associated with an identical access point are switched from infrastructure mode in which the mobile stations communicate via the access point to ad-hoc mode in which the mobile stations directly communicate with each other (e.g., Unexamined Japanese Patent Publication No. 2004-72565). The advantages of switching communication from infrastructure mode to ad-hoc mode are saving of wireless band and reduction of delay. For example, mobile stations associated with a certain access point communicate with each other using a channel other than the wireless frequency band (wireless channel, channel) used by the access point, in which case other mobile stations operating in infrastructure mode have more chance of using the channel of the access point, thus saving the wireless band. Also, the mobile stations which have been switched to ad-hoc mode directly communicate with each other without through the agency of the access point, whereby delay in communication between the mobile stations can be reduced.
Meanwhile, neighboring access points are generally adapted to use different channels. A mobile station belonging to a certain access point is unable to receive radio waves from other access points or detect a mobile station communicating using radio waves of a different access point and thus cannot switch into ad-hoc mode to communicate with such a mobile station. Accordingly, a mobile station regularly performs frequency scanning to receive radio waves of other access points than that to which the mobile station belongs so that the mobile station can switch into ad-hoc mode to communicate with a mobile station associated with a different access point. During the scanning, the mobile station is unable to communicate in infrastructure mode, thus causing overhead. Also, the scanning is basically conducted at regular intervals for updating, and therefore, a time lag inevitably occurs in the case where a new mobile station has been added. Further, where the switching to ad-hoc mode is triggered by mobile stations, in many cases the mobile stations themselves decide to switch to ad-hoc mode in a distributed autonomous manner, which makes it difficult to ensure security as compared with the case of centralized management.
In recent years, wireless LAN switches (also known as wireless LAN controllers) for centralized control of multiple access points have appeared on the market. A wireless LAN switch is capable of centralized management of the statuses (authentication information, encryption information, wireless information) of a plurality of access points. Typical products include those from Meru Corporation, Aruba Corporation, and Airespace Corporation. As functionality for the management of wireless information, a wireless LAN switch has an auto-calibration function whereby interference of radio waves between access points, etc. are measured to estimate and instruct the locations of individual access points, to set channels for the access points, and to automatically set the radio wave transmission powers of the individual access points.
The wireless LAN switch thus manages the statuses of multiple access points and, therefore, is capable of switching the communication mode of mobile stations associated with different access points from infrastructure mode to ad-hoc mode. For example, on detection of infrastructure mode communication between mobile stations associated with different access points, the wireless LAN switch switches the communication mode of the mobile stations to ad-hoc mode.
FIG. 23 illustrates the switching of the communication mode by such a wireless LAN switch. In the figure, a mobile station 224a is communicating with an access point 223a in infrastructure mode by using a channel Ch1, a mobile station 224b is communicating with an access point 223b in infrastructure mode by using a channel Ch6, and a mobile station 224c is communicating with an access point 223c in infrastructure mode by using a channel Ch11. The wireless LAN switch 222 is connected to a backbone network 221. Also, the wireless LAN switch is connected to the access points 223a to 223c by wire for the centralized management of the access points 223a to 223c. 
Based on the address (e.g., MAC (Media Access Control) address) of a packet transferred in a direction indicated by the arrow A1 in the figure, for example, the wireless LAN switch detects the communication originating from the mobile station 224a associated with the access point 223a and terminating at the mobile station 224c associated with the access point 223c and judges that the communication should be switched to ad-hoc mode. Subsequently, the wireless LAN switch 222 transmits an ad-hoc mode switching instruction to each of the mobile stations 224a and 224c, as indicated by the arrows B1a and B1b. The ad-hoc mode switching instruction contains settings information necessary for the mobile stations 224a and 224c to communicate in ad-hoc mode. The settings information includes, for example, IBSSID (Independent Basic Service Set Identifier), ad-hoc communication service channel, and authentication information/encryption information for ad-hoc communication, though the contents somewhat vary depending on the implementation. IBSSID is the identifier of an ad-hoc communication network and is uniquely assigned to each of ad-hoc mode networks created.
Thus, by switching the communication of mobile stations from infrastructure mode to ad-hoc mode, it is possible to save the wireless band on more occasions and also to reduce delay.
When communication between mobile stations associated with different access points is detected, however, the communication is unconditionally switched from infrastructure mode to ad-hoc mode. Accordingly, the switching from infrastructure mode to ad-hoc mode is tried even in cases where the mobile stations are not within each other's coverage of radio waves, giving rise to the problem that the switching often ends in failure.
For example, let it be assumed that the mobile stations 224a and 224c in FIG. 23 are so distant from each other that they are not within each other's coverage of radio waves. In this case, as the mobile station 224a starts to communicate with the mobile station 224c in infrastructure mode, the wireless LAN switch 222 instructs the mobile stations 224a and 224c to switch to ad-hoc mode. However, since the mobile stations 224a and 224c are not within each other's coverage of radio waves, ad-hoc mode communication fails in the end.